package com.qf.flash.ui.business.adapter;

import android.widget.RadioButton;

import com.qf.flash.R;
import com.qf.flash.http.response.GameDetailResponse;
import com.qf.flashlib.adapter.BaseRViewItem;
import com.qf.flashlib.adapter.RViewHolder;

/**
 * 创建日期：2020/3/15 on 14:43
 * 描述:
 * 作者:戴旭东
 */
public class RoleSetItem extends BaseRViewItem<GameDetailResponse.UsersBean> {
    @Override
    public int getItemLayout() {
        return R.layout.item_tole_set;
    }

    @Override
    public void convert(RViewHolder holder, GameDetailResponse.UsersBean entity, int position, int itemSize) {
        RadioButton rb_chosen = holder.getView(R.id.rb_chosen);
        rb_chosen.setChecked(position == holder.getAdapter().getSingleChosenPosition());

        holder.setText(R.id.tv_name, entity.getName())
        .setOnClickListener(R.id.rb_chosen);
    }
}
